#include<map>
#include<set>
#include<cmath>
#include<queue>
#include<vector>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#define rep(i,a,b) for(register int i = (a);i <= (b);++i)
#define per(i,a,b) for(register int i = (a);i >= (b);--i)  
typedef long long ll;
typedef unsigned long long ull;
using std::string;using std::cin;using std::cout;

const int N = 1e5+5;
int _,n,m,p[N],h[N],u,v;
int next[2*N],head[2*N],ver[2*N],tot,val[N],back[N];

inline void link(int x,int y){ver[++tot] = y , next[tot] = head[x] , head[x] = tot;}

inline void dfs(int now,int father){
	val[now] = p[now];
	for(int i = head[now];i;i = next[i]){
		if(ver[i] == father) continue;
		dfs(ver[i],now);
		val[now] += val[ ver[i] ];
	}
}

inline bool check(int now,int father,int num_H){
		// cout << "\n now in " << now << " ";
	bool flag = true;
	int num_happy,num_unhappy,num_now = val[now];
	num_now -= h[now];
		// cout << num_now << " ";
	if(num_now % 2 || num_now < 0) return false;
	else num_now /= 2;
	num_happy = num_now + h[now] , num_unhappy = num_now;
	back[father] += num_happy;
		// cout << num_now << " ";
		// cout << num_happy << " " << num_unhappy << " " << num_H << " ";
	if(num_happy > num_H || num_happy < 0 || num_unhappy < 0) return false;
	for(int i = head[now];i;i = next[i]){
		if(ver[i] == father) continue;
		flag &= check(ver[i],now,num_happy);
		if(!flag) return false;
	}
	if(back[now] > num_happy) return false;
	return true;
}

inline void reset(){
	rep(i,1,tot) head[i] = next[i] = ver[i] = 0;
	tot = 0;
	return;
}

int main(){
	std::ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	//freopen("in.in", "r", stdin);
	cin >> _;
	while(_--){
		reset();
		cin >> n >> m;
		rep(i,1,n) val[i] = back[i] = 0;
		rep(i,1,n) cin >> p[i];
		rep(i,1,n) cin >> h[i];
		rep(i,1,n-1){
			cin >> u >> v;
			link(u,v) , link(v,u);
		}
		dfs(1,0);
		if(check(1,0,m)) cout << "YES\n";
		else cout << "NO\n";
	}
	return 0;
}